/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author BATAQUERO
 */
@Entity
@Table(name = "supervisor")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Supervisor.findAll", query = "SELECT s FROM Supervisor s"),
    @NamedQuery(name = "Supervisor.findByIdSupervisor", query = "SELECT s FROM Supervisor s WHERE s.idSupervisor = :idSupervisor"),
    @NamedQuery(name = "Supervisor.findByCedulaSupervisor", query = "SELECT s FROM Supervisor s WHERE s.cedulaSupervisor = :cedulaSupervisor"),
    @NamedQuery(name = "Supervisor.findByNombresSupervisor", query = "SELECT s FROM Supervisor s WHERE s.nombresSupervisor = :nombresSupervisor"),
    @NamedQuery(name = "Supervisor.findByApellido1Supervisor", query = "SELECT s FROM Supervisor s WHERE s.apellido1Supervisor = :apellido1Supervisor"),
    @NamedQuery(name = "Supervisor.findByApellido2Supervisor", query = "SELECT s FROM Supervisor s WHERE s.apellido2Supervisor = :apellido2Supervisor"),
    @NamedQuery(name = "Supervisor.findByCorreoSupervisor", query = "SELECT s FROM Supervisor s WHERE s.correoSupervisor = :correoSupervisor"),
    @NamedQuery(name = "Supervisor.findByTelefonoSupervisor", query = "SELECT s FROM Supervisor s WHERE s.telefonoSupervisor = :telefonoSupervisor"),
    @NamedQuery(name = "Supervisor.findByCelularSupervisor", query = "SELECT s FROM Supervisor s WHERE s.celularSupervisor = :celularSupervisor"),
    @NamedQuery(name = "Supervisor.findByDireccionSupervisor", query = "SELECT s FROM Supervisor s WHERE s.direccionSupervisor = :direccionSupervisor"),
    @NamedQuery(name = "Supervisor.findByCargoSupervisor", query = "SELECT s FROM Supervisor s WHERE s.cargoSupervisor = :cargoSupervisor"),
    @NamedQuery(name = "Supervisor.findByProfesionSupervisor", query = "SELECT s FROM Supervisor s WHERE s.profesionSupervisor = :profesionSupervisor"),
    @NamedQuery(name = "Supervisor.findByEstadoSupervisor", query = "SELECT s FROM Supervisor s WHERE s.estadoSupervisor = :estadoSupervisor"),
    @NamedQuery(name = "Supervisor.findByIdCoordinadorPracticas", query = "SELECT s FROM Supervisor s WHERE s.idCoordinadorPracticas = :idCoordinadorPracticas")})
public class Supervisor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idSupervisor")
    private Integer idSupervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 12)
    @Column(name = "cedulaSupervisor")
    private String cedulaSupervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "NombresSupervisor")
    private String nombresSupervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "apellido1Supervisor")
    private String apellido1Supervisor;
    @Size(max = 45)
    @Column(name = "apellido2Supervisor")
    private String apellido2Supervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "correoSupervisor")
    private String correoSupervisor;
    @Size(max = 45)
    @Column(name = "telefonoSupervisor")
    private String telefonoSupervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 12)
    @Column(name = "celularSupervisor")
    private String celularSupervisor;
    @Size(max = 60)
    @Column(name = "direccionSupervisor")
    private String direccionSupervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 80)
    @Column(name = "cargoSupervisor")
    private String cargoSupervisor;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "profesionSupervisor")
    private String profesionSupervisor;
    @Column(name = "estadoSupervisor")
    private Boolean estadoSupervisor;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idSupervisor")
    private List<ConvenioXPeriodo> convenioXPeriodoList;
    @JoinColumn(name = "idSupervisor", referencedColumnName = "idUsuario", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Usuario usuario;
    @JoinColumn(name = "idCoordinadorPracticas", referencedColumnName = "idCoordinadorPracticas")
    @ManyToOne(optional = false)
    private CoordinadorPracticas idCoordinadorPracticas;

    public Supervisor() {
    }

    public Supervisor(Integer idSupervisor) {
        this.idSupervisor = idSupervisor;
    }

    public Supervisor(Integer idSupervisor, String cedulaSupervisor, String nombresSupervisor, String apellido1Supervisor, String correoSupervisor, String celularSupervisor, String cargoSupervisor, String profesionSupervisor) {
        this.idSupervisor = idSupervisor;
        this.cedulaSupervisor = cedulaSupervisor;
        this.nombresSupervisor = nombresSupervisor;
        this.apellido1Supervisor = apellido1Supervisor;
        this.correoSupervisor = correoSupervisor;
        this.celularSupervisor = celularSupervisor;
        this.cargoSupervisor = cargoSupervisor;
        this.profesionSupervisor = profesionSupervisor;
    }

    public Integer getIdSupervisor() {
        return idSupervisor;
    }

    public void setIdSupervisor(Integer idSupervisor) {
        this.idSupervisor = idSupervisor;
    }

    public String getCedulaSupervisor() {
        return cedulaSupervisor;
    }

    public void setCedulaSupervisor(String cedulaSupervisor) {
        this.cedulaSupervisor = cedulaSupervisor;
    }

    public String getNombresSupervisor() {
        return nombresSupervisor;
    }

    public void setNombresSupervisor(String nombresSupervisor) {
        this.nombresSupervisor = nombresSupervisor;
    }

    public String getApellido1Supervisor() {
        return apellido1Supervisor;
    }

    public void setApellido1Supervisor(String apellido1Supervisor) {
        this.apellido1Supervisor = apellido1Supervisor;
    }

    public String getApellido2Supervisor() {
        return apellido2Supervisor;
    }

    public void setApellido2Supervisor(String apellido2Supervisor) {
        this.apellido2Supervisor = apellido2Supervisor;
    }

    public String getCorreoSupervisor() {
        return correoSupervisor;
    }

    public void setCorreoSupervisor(String correoSupervisor) {
        this.correoSupervisor = correoSupervisor;
    }

    public String getTelefonoSupervisor() {
        return telefonoSupervisor;
    }

    public void setTelefonoSupervisor(String telefonoSupervisor) {
        this.telefonoSupervisor = telefonoSupervisor;
    }

    public String getCelularSupervisor() {
        return celularSupervisor;
    }

    public void setCelularSupervisor(String celularSupervisor) {
        this.celularSupervisor = celularSupervisor;
    }

    public String getDireccionSupervisor() {
        return direccionSupervisor;
    }

    public void setDireccionSupervisor(String direccionSupervisor) {
        this.direccionSupervisor = direccionSupervisor;
    }

    public String getCargoSupervisor() {
        return cargoSupervisor;
    }

    public void setCargoSupervisor(String cargoSupervisor) {
        this.cargoSupervisor = cargoSupervisor;
    }

    public String getProfesionSupervisor() {
        return profesionSupervisor;
    }

    public void setProfesionSupervisor(String profesionSupervisor) {
        this.profesionSupervisor = profesionSupervisor;
    }

    public Boolean getEstadoSupervisor() {
        return estadoSupervisor;
    }

    public void setEstadoSupervisor(Boolean estadoSupervisor) {
        this.estadoSupervisor = estadoSupervisor;
    }

    @XmlTransient
    public List<ConvenioXPeriodo> getConvenioXPeriodoList() {
        return convenioXPeriodoList;
    }

    public void setConvenioXPeriodoList(List<ConvenioXPeriodo> convenioXPeriodoList) {
        this.convenioXPeriodoList = convenioXPeriodoList;
    }

    public Usuario getUsuario() {
        return usuario;
    }

    public void setUsuario(Usuario usuario) {
        this.usuario = usuario;
    }

    public CoordinadorPracticas getIdCoordinadorPracticas() {
        return idCoordinadorPracticas;
    }

    public void setIdCoordinadorPracticas(CoordinadorPracticas idCoordinadorPracticas) {
        this.idCoordinadorPracticas = idCoordinadorPracticas;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idSupervisor != null ? idSupervisor.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Supervisor)) {
            return false;
        }
        Supervisor other = (Supervisor) object;
        if ((this.idSupervisor == null && other.idSupervisor != null) || (this.idSupervisor != null && !this.idSupervisor.equals(other.idSupervisor))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Supervisor[ idSupervisor=" + idSupervisor + " ]";
    }
    
}
